package com.game.logic.common;

import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
import com.game.logic.messages.GameMessageServerBoot;

public enum CommonEnumRedisKey {
	Player,
	Rank;

	public String getRedisKey(long userId) {
		return getRedisKey() + ":" + userId;
	}

	public String getRedisKey() {
		NacosDiscoveryProperties nacosDiscoveryProperties = GameMessageServerBoot.getApplicationContext()
				.getBean(NacosDiscoveryProperties.class);
		String namespace = nacosDiscoveryProperties.getNamespace();
		return namespace + ":" + this.name().toLowerCase();
	}
}
